﻿using Business.BorrowManagement.Dto;
using Business.BorrowManagement;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Business.SendManagement;
using Business.SendManagement.Dto;

namespace Business.Controllers
{
    [RemoteService]
    [Area("Business")]
    [Route("api/business/send")]
    public class SendController : AbpController
    {
        private readonly ISendAppService _SendAppService;

        public SendController(ISendAppService SendAppService)
        {
            _SendAppService = SendAppService;
        }
        /// <summary>
        /// 添加或修改借阅信息
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>

        [HttpPost]
        [Route("data-post")]
        public Task<SendDto> CreateOrUpdate(SendDto input)
        {
            return _SendAppService.CreateOrUpdate(input);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("delete")]
        public Task Delete(List<Guid> ids)
        {
            return _SendAppService.Delete(ids);
        }
        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>

        [HttpGet]
        [Route("{id}")]
        public Task<SendDto> Get(Guid id)
        {
            return _SendAppService.Get(id);
        }
        /// <summary>
        /// 获得全部
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<PagedResultDto<SendDto>> GetAll(GetSendInputDto input)
        {
            return _SendAppService.GetAll(input);
        }

        /// <summary>
        /// 获得全部（未发货）
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("nogood")]
        public Task<PagedResultDto<SendDto>> GetAllNGood(GetSendInputDto input)
        {
            return _SendAppService.GetAllNGood(input);
        }

        /// <summary>
        /// 获得全部（已发货）
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("good")]
        public Task<PagedResultDto<SendDto>> GetAllGood(GetSendInputDto input)
        {
            return _SendAppService.GetAllGood(input);
        }
    }
}
